//
//  UIView+OSHelp.h
//  UniversalApp
//
//  Created by 凯朱 on 2019/5/31.
//  Copyright © 2019 徐阳. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum :NSInteger{
    LXShadowPathLeft,
    LXShadowPathRight,
    LXShadowPathTop,
    LXShadowPathBottom,
    LXShadowPathNoTop,
    LXShadowPathAllSide
} LXShadowPathSide;

@interface UIView (OSHelp)
+(instancetype)viewFromXIB;
-(void)setTextFieldPlaceholdarWithStr:(NSString *)placeholdar textColor:(UIColor *)textColor font:(UIFont *)font;

/*
 * shadowColor 阴影颜色
 *
 * shadowOpacity 阴影透明度，默认0
 *
 * shadowRadius  阴影半径，默认3
 *
 * shadowPathSide 设置哪一侧的阴影，
 *
 * shadowPathWidth 阴影的宽度，
 *
 * type 1-左上右上 2-全方位 3-左下右下

 */
-(void)LX_SetShadowPathWith:(UIColor *)shadowColor shadowOpacity:(CGFloat)shadowOpacity shadowRadius:(CGFloat)shadowRadius shadowSide:(LXShadowPathSide)shadowPathSide shadowPathWidth:(CGFloat)shadowPathWidth  radiusLocation:(NSInteger)type;

/// 给view绘制虚线边框
/// @param lineWidth 虚线宽
/// @param lineColor 虚线颜色
-(void)drawDashedBorderWith:(CGFloat)lineWidth lineColor:(UIColor *)lineColor;

/**
 设置任意圆角及边框(实线/虚线)
 
 @param corners 要设置的圆角位置集合
 @param radius 圆角半径
 @param lineWidth 边框宽度
 @param lineColor 边框颜色
 @param lineDashPattern 虚线集合
 */
- (void)rounderWithCorners:(UIRectCorner)corners radius:(CGFloat)radius lineWidth:(CGFloat)lineWidth lineColor:(UIColor *_Nullable )lineColor dash:(NSArray<NSNumber *>*_Nullable )lineDashPattern;


/**
 设置任意圆角 --- 性能优化
 
 @param corners 要设置的圆角位置集合
 @param radius 圆角半径
 */
- (void)rounderWithCorners:(UIRectCorner)corners radius:(CGFloat)radius;

/**
 设置圆角 --- 性能优化
 
 @param radius 圆角半径
 */
- (void)roundCornerWithRadius:(CGFloat)radius;
@end

NS_ASSUME_NONNULL_END
